//传入玩家单位，设置装备

params ["_unit"];

_unit forceAddUniform "U_O_CombatUniform_oucamo";

//给予无线电
/*
if(Param_Version >= 183) then{
	_unit addItem "ItemRadio";  
	_unit assignItem "ItemRadio";  
};
*/

//晚上就给荧光弹
if(sunOrMoon < 1) then
{
	//_unit addItem "Chemlight_green";
	//_unit addItem "Chemlight_green";
	//_unit addItem "Chemlight_green";
	_unit addItem "O_NVGoggles_ghex_F";
	_unit assignItem "O_NVGoggles_ghex_F";
};


if(Param_WeaponRespawn == 1) then
{
	if(((getPlayerScores _unit) select 5) >= 0) then
	{
		_unit addWeapon "hgun_Pistol_heavy_02_F";
		_unit addMagazine selectRandom ("hgun_Pistol_heavy_02_F" call fn_getWeaponMag);
	};
};

//新手福利
_unit spawn{
	waitUntil{Sleep 1;_this getVariable ["as_init", false]};
	if(_this getVariable ['as_play_time',0] < 10)then{
		_this remoteExec ["fnc_newPlayer", 2];
	};
};


//___________________________________________特殊判断____________________________________
private _type = typeOf _unit;


if(_type find "TL" >= 0) exitWith
{
	_unit addItem "Rangefinder";//测距仪
};

if(_type find "Medic" >= 0) exitWith
{
	_unit addBackpack "B_Messenger_Black_F";//信使包
	_unit addItem "FirstAidKit";//急救箱 x10
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
	_unit addItem "FirstAidKit";//急救箱
};

if(_type find "Engineer" >= 0) exitWith
{
	_unit addBackpack "O_HMG_01_high_weapon_F";//HMG炮
};//

if(_type find "AMG" >= 0) exitWith
{
	_unit addBackpack "O_HMG_01_support_F";//HMG支架
};

if(_type find "LAT" >= 0) exitWith
{
	_unit addBackpack "B_FieldPack_blk";//战地背包
	_unit addMagazine "RPG7_F";
	_unit addMagazine "RPG7_F";
	_unit addMagazine "RPG7_F";
	_unit addMagazine "RPG7_F";
	_unit addWeapon "launch_RPG7_F";//RPG
};


if(_type find "Exp" >= 0) exitWith
{
	_unit addItem "ItemCompass";
	_unit assignItem "ItemCompass";
	_unit addItem "ItemRadio";
	_unit assignItem "ItemRadio";
	_unit addItem "ItemWatch";
	_unit assignItem "ItemWatch";
};

if(_type find "_M_" >= 0) exitWith
{
	_unit addItem "optic_LRPS";//高倍镜
};

if(_type find "JTAC" >= 0) exitWith
{
	if(Param_Version > 183) then
	{
		_unit addBackpack "O_UGV_02_Demining_backpack_F";//无人机
	}
	else
	{
		_unit addBackpack "O_UAV_06_medical_backpack_F";//无人机
	};
	
};

if(_type find "GL" >= 0) exitWith
{
	_unit addMagazine "MiniGrenade";//RGN x 5
	_unit addMagazine "MiniGrenade";
	_unit addMagazine "MiniGrenade";
	_unit addMagazine "MiniGrenade";
	_unit addMagazine "MiniGrenade";
};

if(_type find "AR" >= 0) exitWith
{
	_unit addItem "bipod_02_F_blk";//双脚架
};

if(_type find "repair_F" >= 0) exitWith
{
	_unit addItem "MineDetector";//探雷器
};

if(_type find "hex" >= 0) exitWith
{
	_unit addBackpack "B_Bergen_tna_F";//大背包
};

if(_type find "Soldier_A" >= 0) exitWith
{
	_unit addBackpack "B_Bergen_tna_F";//大背包
};

if(_type find "Pilot" >= 0) exitWith
{
	_unit addHeadgear "H_PilotHelmetFighter_O";//夜视头盔
	_unit addBackpack "O_HMG_01_support_F";//HMG支架
};




